#!/bin/bash
#PBS -N test
#PBS -V
#PBS -l nodes=4:ppn=8,walltime=3:00:00

. /opt/modules/Modules/3.2.6/init/bash
 module load intel openmpi
cd /lustre/home/mpotts/FEM/Regression.d/nlstatics
../create_mfiles.pl
echo mpirun -n 2 ../../bin/aeros  nlstatics_sparse_gdisplac.inp
mpirun -n 2 --machinefile host.0 ../../bin/aeros  nlstatics_sparse_gdisplac.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_skyline_stressvm.inp
mpirun -n 2 --machinefile host.1 ../../bin/aeros  nlstatics_skyline_stressvm.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_mumps_strainxx.inp
mpirun -n 2 --machinefile host.2 ../../bin/aeros  nlstatics_mumps_strainxx.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_spooles_strainxy.inp
mpirun -n 2 --machinefile host.3 ../../bin/aeros  nlstatics_spooles_strainxy.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_spooles_pivot_strainxz.inp
mpirun -n 2 --machinefile host.4 ../../bin/aeros  nlstatics_spooles_pivot_strainxz.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_mumps_pivot_strainxx.inp
mpirun -n 2 --machinefile host.5 ../../bin/aeros  nlstatics_mumps_pivot_strainxx.inp &
echo mpirun -n 2 ../../bin/aeros -n 2 --dec --nsub 4 nlstatics_FETI_DP_strainxy.inp
mpirun -n 2 --machinefile host.6 ../../bin/aeros -n 2 --dec --nsub 4 nlstatics_FETI_DP_strainxy.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_sparse_strainxz.inp
mpirun -n 2 --machinefile host.7 ../../bin/aeros  nlstatics_sparse_strainxz.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_skyline_strainxx.inp
mpirun -n 2 --machinefile host.8 ../../bin/aeros  nlstatics_skyline_strainxx.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_mumps_strainxy.inp
mpirun -n 2 --machinefile host.9 ../../bin/aeros  nlstatics_mumps_strainxy.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_spooles_strainvm.inp
mpirun -n 2 --machinefile host.10 ../../bin/aeros  nlstatics_spooles_strainvm.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_spooles_pivot_strainxz.inp
mpirun -n 2 --machinefile host.11 ../../bin/aeros  nlstatics_spooles_pivot_strainxz.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_mumps_pivot_displmod.inp
mpirun -n 2 --machinefile host.12 ../../bin/aeros  nlstatics_mumps_pivot_displmod.inp &
echo mpirun -n 2 ../../bin/aeros -n 2 --dec --nsub 4 nlstatics_FETI_DP_gdispmod.inp
mpirun -n 2 --machinefile host.13 ../../bin/aeros -n 2 --dec --nsub 4 nlstatics_FETI_DP_gdispmod.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_sparse_displacx.inp
mpirun -n 2 --machinefile host.14 ../../bin/aeros  nlstatics_sparse_displacx.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_skyline_displacy.inp
mpirun -n 2 --machinefile host.15 ../../bin/aeros  nlstatics_skyline_displacy.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_mumps_displacz.inp
mpirun -n 2 --machinefile host.16 ../../bin/aeros  nlstatics_mumps_displacz.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_spooles_strainp1.inp
mpirun -n 2 --machinefile host.17 ../../bin/aeros  nlstatics_spooles_strainp1.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_spooles_pivot_strainp2.inp
mpirun -n 2 --machinefile host.18 ../../bin/aeros  nlstatics_spooles_pivot_strainp2.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_mumps_pivot_strainp3.inp
mpirun -n 2 --machinefile host.19 ../../bin/aeros  nlstatics_mumps_pivot_strainp3.inp &
echo mpirun -n 2 ../../bin/aeros -n 2 --dec --nsub 4 nlstatics_FETI_DP_stressp1.inp
mpirun -n 2 --machinefile host.20 ../../bin/aeros -n 2 --dec --nsub 4 nlstatics_FETI_DP_stressp1.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_sparse_stressp2.inp
mpirun -n 2 --machinefile host.21 ../../bin/aeros  nlstatics_sparse_stressp2.inp &
echo mpirun -n 2 ../../bin/aeros  nlstatics_skyline_stressp3.inp
mpirun -n 2 --machinefile host.22 ../../bin/aeros  nlstatics_skyline_stressp3.inp &
wait %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16 %17 %18 %19 %20 %21 %22 %23 
